﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TruckingApplication.Dal.EntityModels;
using System.Data.Entity;
using TruckingApplication.Web.Helpers;
    
namespace TruckingApplication.Web.Controllers
{
    public class HomeController : Controller
    {
        private TRUCKING_FRAMEWORK_Entities_2 entities = new TRUCKING_FRAMEWORK_Entities_2();

        public ActionResult Index()
        {
            var companyTypeLookup = new Dictionary<int, List<string>>();
            var co = from c in entities.COMPANies select c;
            //foreach(var c in entities.COMPANY_TYPE.ToList())
            //{
            //    companyTypeLookup.Add(int.Parse(c.companyTypeID.ToString()), new List<string>{c.companyType, c.descrip});
            //}

            for (var i = 0; i < 4; i++)
            {
                companyTypeLookup.Add(i, new List<string> { "Company Type " + i.ToString(), "My company type is " + i.ToString() });
            }
            // Get Company Types

            ViewBag.CompanyTypes = companyTypeLookup;

            //ViewBag.Message = "Welcome to ASP.NET MVC!";

            MvcBasicLog._logSource = "Trucking Application";
            MvcBasicLog.AddLogLine("You hit home page", false);

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
